<?php $this->load->view("general/header");?>
<script type="text/javascript">
	$(function(){
	$("#banner_list").load($("#base_url").attr("alt")+"admin/system/banner_load");
	});
</script>
<div id="banner" class="page_">
    <div class="form">            	
        <div class="form_header">Banner</div>
        <div class="content_data">
            <form method="post" action="<?php echo base_url();?>admin/system/banner" enctype="multipart/form-data">
                <div class="title">Title</div> <div class="input"><input type="text" name="title" value="<?php echo set_value('title');?>" /></div>
                <div class="errorField"><?php echo str_replace("The","",str_replace("field","",form_error('title'))); ?></div>
                <div class="clear"></div>
                <div class="title">Image</div> <div class="input"><input type="file" name="image" /><br />(width must be 624px and height must be 298px, or ratio width:height between 2 and 2.1)</div>
                <div class="errorField"><?php echo (isset($pesan_upload))?$pesan_upload:""; ?></div>
                <div class="clear"></div>
                <div class="title">Link To</div> <div class="input">
                    <select name="link_to">
                        <option value="">No Link</option>
                        <optgroup label="Product">
                        	<?php foreach($link_to['product'] as $link){ ?>
                            <option value="product/detail/<?php echo $link['product_id'];?>"><?php echo $link['name'];?></option>
							<?php } ?>
                        </optgroup>
                        <optgroup label="News">
                            <?php foreach($link_to['news'] as $link){ ?>
                            <option value="news/detail/<?php echo $link['news_id'];?>"><?php echo $link['news_title'];?></option>
							<?php } ?>
                        </optgroup>
                    </select>
                </div>
                <div class="clear"></div>
                <input type="submit" name="btnSave" value="Save" class="button_red" />
            </form>
            <div class="success"><?php echo (isset($pesan_sukses))?$pesan_sukses:"";?></div>
        </div>
        <div class="form_header">Banner List</div>
        <div id="banner_list">
        	
        </div>
    </div>
</div>
<?php $this->load->view("general/footer");?>